export default {
  data() {
    return {
      rules: {
        background: [
          { required: true, message: "请选择出身", trigger: "blur" }
        ],
        birthday: [{ required: true, message: "请选择生日", trigger: "blur" }],
        cageId: [
          { required: true, message: "请选择笼子编号", trigger: "blur" }
        ],
        hairFeature: [
          { required: true, message: "请选择毛发特点", trigger: "blur" }
        ],
        hairLength: [
          { required: true, message: "请选择毛发长短", trigger: "blur" }
        ],
        name: [{ required: true, message: "请填写名字", trigger: "blur" }],
        origin: [{ required: true, message: "请选择来源", trigger: "blur" }],
        personality: [
          { required: true, message: "请选择性格特点", trigger: "blur" }
        ],
        sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
        size: [{ required: true, message: "请选择体型", trigger: "blur" }],
        sterilization: [
          { required: true, message: "请选择绝育情况", trigger: "blur" }
        ],
        yardId: [{ required: true, message: "请选择小院id", trigger: "blur" }]
      },
      options: {
        background: [
          {
            label: "未知",
            value: 0
          },
          {
            label: "被遗弃",
            value: 1
          },
          {
            label: "跑丢",
            value: 2
          },
          {
            label: "流浪二代",
            value: 3
          }
        ],
        cageId: [],
        hairFeature: [
          {
            label: "卷毛",
            value: 1
          },
          {
            label: "长毛",
            value: 2
          }
        ],
        hairLength: [
          {
            label: "无毛",
            value: 1
          },
          {
            label: "短毛",
            value: 2
          },
          {
            label: "长毛",
            value: 3
          }
        ],
        origin: [
          {
            label: "未知",
            value: 0
          },
          {
            label: "城区",
            value: 1
          },
          {
            label: "农村",
            value: 2
          }
        ],
        personality: [
          {
            label: "未知",
            value: 0
          },
          {
            label: "胆小谨慎",
            value: 1
          },
          {
            label: "安静乖巧",
            value: 2
          },
          {
            label: "活泼开朗",
            value: 3
          }
        ],
        sex: [
          {
            label: "未知",
            value: 0
          },
          {
            label: "公",
            value: 1
          },
          {
            label: "母",
            value: 2
          }
        ],
        size: [
          {
            label: "小型犬",
            value: 1
          },
          {
            label: "中型犬",
            value: 2
          },
          {
            label: "大型犬",
            value: 3
          }
        ],
        sterilization: [
          {
            label: "未知",
            value: 0
          },
          {
            label: "未绝育",
            value: 1
          },
          {
            label: "已绝育",
            value: 2
          }
        ]
      }
    }
  },
  methods: {
    formatSize({ row }) {
      switch (row.size) {
        case 1:
          return "超小型犬"
        case 2:
          return "超小型犬"
        case 3:
          return "超小型犬"
        default:
          return "大型犬"
      }
    },
    formatVaccine({ row }) {
      switch (row.sterilization) {
        case 0:
          return "已绝育"
        case 1:
          return "未绝育"
        default:
          return "未知"
      }
    }
  }
}
